package com.yntsoft.util;

public class TestCache {

	public static void main(String[] args) {
        /*  Cache levelOneCache = cacheManager.getCache("levelOneCache");
          CacheObject cacheObject = null;*/
         /* for (int i = 0; i < 10; i++) {
              Element element = levelOneCache.get("key");
              if (element == null) {
                  cacheObject = new CacheObject("test");
                  element = new Element("key", cacheObject);
                  levelOneCache.put(element);
                  System.out.println("cacheObject[" + cacheObject + "]" + ",无法从缓存中取到");
              } else {
                  cacheObject =(CacheObject) element.getObjectValue();
                  System.out.println("cacheObject[" + cacheObject + "]" + ",从缓存中取到");
              }
          }*/
          EhcacheUtil ehcacheUtil = EhcacheUtil.getInstance();
          ehcacheUtil.put("test", "test-01", "ehcacheUtil");/**/
          System.out.println(ehcacheUtil.get("test"));
          System.out.println(ehcacheUtil.get("test", "test-01")); /**/
          
          ehcacheUtil.put("testJiHe", "jihe", new String[]{"123","234","5678"});
          System.out.println(ehcacheUtil.get("testJiHe"));
          System.out.println(ehcacheUtil.get("testJiHe", "jihe"));
	}
}
